<?php defined('RUN_KATANA') or die('Restricted access'); ?>
<?php 
if(!$_POST)
{
	if($ac->getUserGroups())
	{
		$levels = $ac->getAccessLevels();
		foreach($ac->getUserGroups() as $item)
		{
			echo '<tr class="items">';
			echo '<td class="first center">'.$item->getId().'</td>';
			echo '<td>';
			echo 	'<input type="hidden" name="user_group_id[]" value="'.$item->getId().'" />';
			echo 	'<div style="display:none;">'.$item.'</div>';
			echo 	'<input class="select_list" type="checkbox" name="selected[]" value="'.$item->getId().'" /></td>';
			echo '<td><input class="small" name="user_group_title[]" type="text" value="'.$item->getTitle().'" maxlength="80" /></td>';
			?>
			<td>
				<select name="user_group_level[]" class="small-m" onchange="submit();">
					<?php 
					if($levels)
					{
						foreach($levels as $level)
						{ 
							echo '<option value="'.$level->getId().'" '.$txt->getIsSelectedHTML($item->getLevel(), $level->getId()) .'>'.$level->getId().' - '.$level->getTitle().'</option>';
						}
					}
					?>
				</select>
			</td>
			<td>
				<?php echo $commander->getActivationFieldsObjectAjax($item); ?>
				<input type="hidden" name="user_group_active[]" value="<?php echo $item->getActive(); ?>" />
			</td>
			<?php /*
			<td class="center">
				<a href="?con=<?php echo $_REQUEST['con']; ?>&amp;group=<?php echo $item->getId(); ?>"><img title="<?php echo ucfirst($txt->getWord('edit')); ?>" class="icon command" src="<?php echo SYSICONS_URL; ?>configure_16.gif" /></a>
			</td>
			*/ ?>
			<td class="last center">
			<?php if($item->getId() > 6):  ?>
			<img title="<?php echo ucfirst($txt->getWord('delete').' '.$txt->getWord('user_group')); ?>" class="icon command provider_delete" src="<?php echo SYSICONS_URL; ?>delete_16.gif" onclick="deleteDialog(<?php echo $item->getId(); ?>);" />
			<?php endif; ?>
			</td>
			<?php
			echo '</tr>';
		}
	}
	else
	{
		echo '<tr class="items">';
		echo '<td class="first center">0</td>';
		echo '<td class="center">';
		echo 	'<input class="select_list" type="checkbox" name="selected[]" value="0" /></td>';
		echo '<td>'.ucfirst($txt->getWord('no_items')).'</td>';
		?>
		<td>
			<input type="hidden" name="provider_active[]" value="0" />
		</td>
		<td>&nbsp;</td>
		<td class="last center">&nbsp;</td>
		<?php
		echo '</tr>';
	}
}
?>